﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace ZR.Infrastructure.ANet
{
    public class SHA256Util
    {
        public static string GetSHA256(string s)
        {
            string ret = "";
            SHA256 mySHA256 = SHA256.Create();
            byte[] array = mySHA256.ComputeHash(System.Text.Encoding.UTF8.GetBytes(s));
            for (int i = 0; i < array.Length; i++)
            {
                ret += string.Format("{0:x2}", array[i]);
            }
            return ret;
        }
    }
}
